package cn.sys.util;

import cn.hutool.json.JSONUtil;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 自定义的响应工具类
 *
 */

public class ResponseUtil {
    public static void send(HttpServletResponse resp, ResultData resultData) throws IOException {
        // 将得到的resultData结果集转为json格式发送给前端
        String jsonStr = JSONUtil.toJsonStr(resultData);
        resp.setContentType("json/application;charset=utf8");
        resp.getWriter().write(jsonStr);
    }
}